toDynamicPerimeterDp

fun Number.toDynamicPerimeterDp(qualifier: DpQualifier, inverter: Inverter = Inverter.DEFAULT, ignoreMultiWindows: Boolean = false, applyAspectRatio: Boolean = false, customSensitivityK: Float? = null): ERROR CLASS: Symbol not found for Dp

EN Converts a Number (base Dp value) into a dynamically scaled Dp for use in Jetpack Compose.

The scaling logic:

  1. Checks DimenCache first. On a cache hit, returns the precomputed value; otherwise, computes via calculatePerimeterDpCompose and stores it.

  2. Uses the internal bypass mechanism in DimenCache for sub-nanosecond latency on common width-scaling paths.

  3. The remember block ensures recalculation only when configuration changes.

⚠️ Bypass note: when applyAspectRatio is false and qualifier is SMALL_WIDTH with DEFAULT inverter, the cache is bypassed internally because a raw multiply (~2 ns) is faster than the cache lookup (~5 ns). This is intentional and not a bug.

PT Converte um Number (valor Dp base) em um Dp dinamicamente escalado para uso no Jetpack Compose.

A lógica de escalonamento:

  1. Consulta o DimenCache primeiro. No acerto, retorna o Float cacheado; no miss, calcula via calculatePerimeterDpCompose e armazena.

  2. O bloco remember garante que o valor só seja recalculado quando um parâmetro de configuração realmente muda.

Return

Dynamically scaled Dp value.

Parameters

qualifier
inverter

Orientation-based dimension swap rule (default: Inverter.DEFAULT).

ignoreMultiWindows

If true, returns the base value unscaled when the app is in split-screen.

applyAspectRatio

If true, applies aspect-ratio multiplier for more aggressive scaling.

customSensitivityK

Override for the AR sensitivity constant (null = library default).